.variants-form {
  display: flex;
  flex-direction: column;
  gap: 2rem;

  .options-creator {
    margin: 1rem;
    padding: 0.5rem;
    border: 1px solid $border-color;
    border-radius: $border-radius;

    &:not(:has(.options-creator__options_container .options-creator__option)) {
      margin: 0;
      border: none;
      
      .options-creator__option--new {
        padding-left: 1rem;
      }
    }
    &:has(.options-creator__option--new:not(.d-none)) {
      border: 1px solid $border-color;
      border-radius: $border-radius;
      margin: 1rem;
      margin-bottom: 1rem;
    }

    &__option {
      display: flex;
      border-bottom: 1px solid $border-color;
      padding: 0.5rem 0.5rem 1rem 0;
      margin-bottom: 0.5rem;

      .label {
        margin-bottom: 0.5rem;
        font-weight: $font-weight-medium;
        display: inline-block;
      }

      .draggable {
        @extend .btn;
        @extend .px-2;
        @extend .py-0;
        @extend .mr-3;
        cursor: grab !important;
        padding-right: 1rem;
        align-items: center;
        justify-content: center;
        min-width: calc(16px + 1rem);

        i {
          margin-right: 0;
        }

        &:hover {
          background-color: $gray-25;
        }
      }

      &--new {
        padding-left: calc(1.13px + 3.25rem);
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0.5rem;

        .values-inputs {
          display: flex;
          flex-direction: column;
          gap: 0.25rem;
        }
      }

      &--form {
        @extend .options-creator__option--new;
      }
    }
    &__option:first-child {
      border-top: 0;
    }

    .new_option_button {
      @extend .btn;
      @extend .btn-secondary;
      @extend .py-2;
      width: 100%;
      justify-content: flex-start;
    }
  }

  .variants-table {
    display: flex;
    flex-direction: column;

    .column-checkbox,
    .column-variant,
    .column-price,
    .column-quantity,
    .column-actions {
      display: inline-flex;
      align-items: center;
    }

    .column-checkbox {
      justify-content: center;
      flex-grow: 0;
      flex-basis: 2rem;
    }
    .column-variant {
      user-select: none;
      flex-grow: 3;
      flex-basis: 0;
    }
    .column-price {
      flex-grow: 1;
      flex-basis: 0;
    }
    .column-actions {
      flex-grow: 0;
      flex-basis: 5rem;
    }
    .column-quantity {
      justify-content: space-between;
      width: 100%;
      line-height: 28px;
      flex-grow: 1;
      flex-basis: 0;
    }

    .delete-button {
      @extend .btn;
      @extend .btn-danger;
      @extend .btn-sm;
    }

    &__actions {
      display: none;
      width: 100%;
      justify-content: flex-end;
      padding: 1rem;
      padding-top: 0;

      &:has(*) {
        display: flex;
      }

      &__select {
        width: min-content;
        padding-right: 1.75rem;
      }
    }

    &__header,
    &__footer {
      display: flex;
      @extend .text-muted;
      width: 100%;
      padding: 0 1rem;
      gap: 0.25rem;
      background-color: rgba($gray-25, 0.5);

      &__cell {
        display: inline-block;
      }
    }

    &__footer {
      justify-content: center;
      align-items: center;
      padding-top: 0.5rem;
      padding-bottom: 0.5rem;
      border-radius: $border-radius;
      border-top-left-radius: 0;
      border-top-right-radius: 0;
      border-bottom-left-radius: $border-radius-lg;
      border-bottom-right-radius: $border-radius-lg;
    }

    &__body {
      display: flex;
      flex-direction: column;

      &__row {
        padding: 0 1rem;
        width: 100%;
        display: flex;
        gap: 0.25rem;

        border-bottom: 1px solid $table-border-color;

        &.nested {
          .column-checkbox,
          .column-variant {
            left: 1.25rem;
            position: relative;
          }
          .column-variant {
            width: calc(100% - 1.25rem);
          }
        }
      }
      &__cell {
        padding: 0.5rem 0;
        display: block;
      }
    }
  }
}
